/**
 * 专门处理 counter 相关的 reducer
 */

const initialState = 0;

export default function counterReducer(state = initialState, action: any) {
  console.log("counterReducer");
  switch (action.type) {
    case "counter/increment":
      return state + 1;
    case "counter/decremenet":
      return state - 1;
    default:
      return state;
  }
}
